ConstraintLayout  

您所在的位置:网站首页 android studio constraint ConstraintLayout  

ConstraintLayout  

2024-06-23 07:20| 来源: 网络整理| 查看: 265

ConstraintLayout Artifact: androidx.constraintlayout:constraintlayout View Source Added in 2.2.0-alpha13 Kotlin |Java

class ConstraintLayout : ViewGroup kotlin.Any    ↳ android.view.View      ↳ android.view.ViewGroup        ↳ androidx.constraintlayout.widget.ConstraintLayout Known direct subclasses MotionLayout MotionLayout

A subclass of ConstraintLayout that supports animating between various states Added in 2.0

A ConstraintLayout is a android.view.ViewGroup which allows you to position and size widgets in a flexible way.

Note:ConstraintLayout is available as a support library that you can use on Android systems starting with API level 9 (Gingerbread). As such, we are planning on enriching its API and capabilities over time. This documentation will reflect those changes.

There are currently various types of constraints that you can use:

Relative positioning Margins Centering positioning Circular positioning Visibility behavior Dimension constraints Chains Virtual Helpers objects Optimizer

Note that you cannot have a circular dependency in constraints.

Also see ConstraintLayout.LayoutParams for layout attributes

Developer Guide Relative positioning

Relative positioning is one of the basic building blocks of creating layouts in ConstraintLayout. Those constraints allow you to position a given widget relative to another one. You can constrain a widget on the horizontal and vertical axis:

Horizontal Axis: left, right, start and end sides Vertical Axis: top, bottom sides and text baseline

The general concept is to constrain a given side of a widget to another side of any other widget.

For example, in order to position button B to the right of button A:

you would need to do:

This tells the system that we want the left side of button B to be constrained to the right side of button A. Such a position constraint means that the system will try to have both sides share the same location.

Here is the list of available constraints:

layout_constraintLeft_toLeftOf layout_constraintLeft_toRightOf layout_constraintRight_toLeftOf layout_constraintRight_toRightOf layout_constraintTop_toTopOf layout_constraintTop_toBottomOf layout_constraintBottom_toTopOf layout_constraintBottom_toBottomOf layout_constraintBaseline_toBaselineOf layout_constraintStart_toEndOf layout_constraintStart_toStartOf layout_constraintEnd_toStartOf layout_constraintEnd_toEndOf

They all take a reference id to another widget, or the parent (which will reference the parent container, i.e. the ConstraintLayout):

Margins

If side margins are set, they will be applied to the corresponding constraints (if they exist), enforcing the margin as a space between the target and the source side. The usual layout margin attributes can be used to this effect:

android:layout_marginStart android:layout_marginEnd android:layout_marginLeft android:layout_marginTop android:layout_marginRight android:layout_marginBottom layout_marginBaseline

Note that a margin can only be positive or equal to zero, and takes a Dimension.

Margins when connected to a GONE widget

When a position constraint target's visibility is View.GONE, you can also indicate a different margin value to be used using the following attributes:

layout_goneMarginStart layout_goneMarginEnd layout_goneMarginLeft layout_goneMarginTop layout_goneMarginRight layout_goneMarginBottom layout_goneMarginBaseline Centering positioning and bias

A useful aspect of ConstraintLayout is in how it deals with "impossible" constraints. For example, if we have something like:

Unless the ConstraintLayout happens to have the exact same size as the Button, both constraints cannot be satisfied at the same time (both sides cannot be where we want them to be).

What happens in this case is that the constraints act like opposite forces pulling the widget apart equally; such that the widget will end up being centered in the parent container. This will apply similarly for vertical constraints.

Bias

The default when encountering such opposite constraints is to center the widget; but you can tweak the positioning to favor one side over another using the bias attributes:

layout_constraintHorizontal_bias layout_constraintVertical_bias

For example the following will make the left side with a 30% bias instead of the default 50%, such that the left side will be shorter, with the widget leaning more toward the left side:

Using bias, you can craft User Interfaces that will better adapt to screen sizes changes. Circular positioning (Added in 1.1)

You can constrain a widget center relative to another widget center, at an angle and a distance. This allows you to position a widget on a circle. The following attributes can be used:

layout_constraintCircle : references another widget id layout_constraintCircleRadius : the distance to the other widget center layout_constraintCircleAngle : which angle the widget should be at (in degrees, from 0 to 360) Visibility behavior

ConstraintLayout has a specific handling of widgets being marked as View.GONE.

GONE widgets, as usual, are not going to be displayed and are not part of the layout itself (i.e. their actual dimensions will not be changed if marked as GONE).

But in terms of the layout computations, GONE widgets are still part of it, with an important distinction:

For the layout pass, their dimension will be considered as zero (basically, they will be resolved to a point) If they have constraints to other widgets they will still be respected, but any margins will be as if equals to zero

This specific behavior allows to build layouts where you can temporarily mark widgets as being GONE, without breaking the layout, which can be particularly useful when doing simple layout animations.

Note: The margin used will be the margin that B had defined when connecting to A. In some cases, this might not be the margin you want (e.g. A had a 100dp margin to the side of its container, B only a 16dp to A, marking A as gone, B will have a margin of 16dp to the container). For this reason, you can specify an alternate margin value to be used when the connection is to a widget being marked as gone (see the section above about the gone margin attributes).

Dimensions constraints Minimum dimensions on ConstraintLayout

You can define minimum and maximum sizes for the ConstraintLayout itself:

android:minWidth set the minimum width for the layout android:minHeight set the minimum height for the layout android:maxWidth set the maximum width for the layout android:maxHeight set the maximum height for the layout Those minimum and maximum dimensions will be used by ConstraintLayout when its dimensions are set to WRAP_CONTENT. Widgets dimension constraints

The dimension of the widgets can be specified by setting the android:layout_width and android:layout_height attributes in 3 different ways:

Using a specific dimension (either a literal value such as 123dp or a Dimension reference) Using WRAP_CONTENT, which will ask the widget to compute its own size Using 0dp, which is the equivalent of "MATCH_CONSTRAINT"

The first two works in a similar fashion as other layouts. The last one will resize the widget in such a way as matching the constraints that are set. If margins are set, they will be taken in account in the computation.

Important: MATCH_PARENT is not recommended for widgets contained in a ConstraintLayout. Similar behavior can be defined by using MATCH_CONSTRAINT with the corresponding left/right or top/bottom constraints being set to "parent".

WRAP_CONTENT : enforcing constraints (Added in 1.1)

If a dimension is set to WRAP_CONTENT, in versions before 1.1 they will be treated as a literal dimension -- meaning, constraints will not limit the resulting dimension. While in general this is enough (and faster), in some situations, you might want to use WRAP_CONTENT, yet keep enforcing constraints to limit the resulting dimension. In that case, you can add one of the corresponding attribute:

app:layout_constrainedWidth="true|false" app:layout_constrainedHeight="true|false" MATCH_CONSTRAINT dimensions (Added in 1.1)

When a dimension is set to MATCH_CONSTRAINT, the default behavior is to have the resulting size take all the available space. Several additional modifiers are available:

layout_constraintWidth_min and layout_constraintHeight_min : will set the minimum size for this dimension layout_constraintWidth_max and layout_constraintHeight_max : will set the maximum size for this dimension layout_constraintWidth_percent and layout_constraintHeight_percent : will set the size of this dimension as a percentage of the parent Min and Max

The value indicated for min and max can be either a dimension in Dp, or "wrap", which will use the same value as what WRAP_CONTENT would do.

Percent dimension

To use percent, you need to set the following

The dimension should be set to MATCH_CONSTRAINT (0dp) The default should be set to percent app:layout_constraintWidth_default="percent" or app:layout_constraintHeight_default="percent" Then set the layout_constraintWidth_percent or layout_constraintHeight_percent attributes to a value between 0 and 1 Ratio

You can also define one dimension of a widget as a ratio of the other one. In order to do that, you need to have at least one constrained dimension be set to 0dp (i.e., MATCH_CONSTRAINT), and set the attribute layout_constraintDimensionRatio to a given ratio. For example:

will set the height of the button to be the same as its width.

The ratio can be expressed either as:

a float value, representing a ratio between width and height a ratio in the form "width:height"

You can also use ratio if both dimensions are set to MATCH_CONSTRAINT (0dp). In this case the system sets the largest dimensions that satisfies all constraints and maintains the aspect ratio specified. To constrain one specific side based on the dimensions of another, you can pre append W," or H, to constrain the width or height respectively. For example, If one dimension is constrained by two targets (e.g. width is 0dp and centered on parent) you can indicate which side should be constrained, by adding the letter W (for constraining the width) or H (for constraining the height) in front of the ratio, separated by a comma:

will set the height of the button following a 16:9 ratio, while the width of the button will match the constraints to its parent. Chains

Chains provide group-like behavior in a single axis (horizontally or vertically). The other axis can be constrained independently.

Creating a chain

A set of widgets are considered a chain if they are linked together via a bi-directional connection.

Chain heads

Chains are controlled by attributes set on the first element of the chain (the "head" of the chain):

The head is the left-most widget for horizontal chains, and the top-most widget for vertical chains.

Margins in chains

If margins are specified on connections, they will be taken into account. In the case of spread chains, margins will be deducted from the allocated space.

Chain Style

When setting the attribute layout_constraintHorizontal_chainStyle or layout_constraintVertical_chainStyle on the first element of a chain, the behavior of the chain will change according to the specified style (default is CHAIN_SPREAD).

CHAIN_SPREAD -- the elements will be spread out (default style) Weighted chain -- in CHAIN_SPREAD mode, if some widgets are set to MATCH_CONSTRAINT, they will split the available space CHAIN_SPREAD_INSIDE -- similar, but the endpoints of the chain will not be spread out CHAIN_PACKED -- the elements of the chain will be packed together. The horizontal or vertical bias attribute of the child will then affect the positioning of the packed elements Weighted chains

The default behavior of a chain is to spread the elements equally in the available space. If one or more elements are using MATCH_CONSTRAINT, they will use the available empty space (equally divided among themselves). The attribute layout_constraintHorizontal_weight and layout_constraintVertical_weight will control how the space will be distributed among the elements using MATCH_CONSTRAINT. For example, on a chain containing two elements using MATCH_CONSTRAINT, with the first element using a weight of 2 and the second a weight of 1, the space occupied by the first element will be twice that of the second element.

Margins and chains (in 1.1)

When using margins on elements in a chain, the margins are additive.

For example, on a horizontal chain, if one element defines a right margin of 10dp and the next element defines a left margin of 5dp, the resulting margin between those two elements is 15dp.

An item plus its margins are considered together when calculating leftover space used by chains to position items. The leftover space does not contain the margins.

Virtual Helper objects

In addition to the intrinsic capabilities detailed previously, you can also use special helper objects in ConstraintLayout to help you with your layout. Currently, the Guideline{@see Guideline} object allows you to create Horizontal and Vertical guidelines which are positioned relative to the ConstraintLayout container. Widgets can then be positioned by constraining them to such guidelines. In 1.1, Barrier and Group were added too.

Optimizer (in 1.1)

In 1.1 we exposed the constraints optimizer. You can decide which optimizations are applied by adding the tag app:layout_optimizationLevel to the ConstraintLayout element.

none : no optimizations are applied standard : Default. Optimize direct and barrier constraints only direct : optimize direct constraints barrier : optimize barrier constraints chain : optimize chain constraints (experimental) dimensions : optimize dimensions measures (experimental), reducing the number of measures of match constraints elements

This attribute is a mask, so you can decide to turn on or off specific optimizations by listing the ones you want. For example: app:layout_optimizationLevel="direct|barrier|chain"

Summary Nested types class ConstraintLayout.LayoutParams : ViewGroup.MarginLayoutParams

This class contains the different attributes specifying how a view want to be laid out inside a ConstraintLayout.

interface ConstraintLayout.ValueModifier

This is the interface to a valued modifier. implement this and add it using addValueModifier

Constants const Int DESIGN_INFO_ID = 0 const String! VERSION = "ConstraintLayout-2.2.0-alpha04" Public constructors ConstraintLayout(context: Context) ConstraintLayout(context: Context, attrs: AttributeSet?) ConstraintLayout(context: Context, attrs: AttributeSet?, defStyleAttr: Int) @TargetApi(value = Build.VERSION_CODES.LOLLIPOP)ConstraintLayout(    context: Context,    attrs: AttributeSet?,    defStyleAttr: Int,    defStyleRes: Int) Public functions Unit addValueModifier(modifier: ConstraintLayout.ValueModifier!)

a ValueModify to the ConstraintLayout.

Unit fillMetrics(metrics: Metrics!) Unit forceLayout() ConstraintLayout.LayoutParams! generateLayoutParams(attrs: AttributeSet!) Any! getDesignInformation(type: Int, value: Any!) Int getMaxHeight()

The maximum height of this view.

Int getMaxWidth() Int getMinHeight()

The minimum height of this view.

Int getMinWidth()

The minimum width of this view.

Int getOptimizationLevel()

Return the current optimization level for the layout resolution

String! getSceneString()

Returns a JSON5 string useful for debugging the constraints actually applied.

java-static SharedValues! getSharedValues()

Returns the SharedValues instance, creating it if it doesn't exist.

View! getViewById(id: Int) ConstraintWidget! getViewWidget(view: View!) Unit loadLayoutDescription(layoutDescription: Int)

Load a layout description file from the resources.

Unit onViewAdded(view: View!) Unit onViewRemoved(view: View!) Unit requestLayout() Unit setConstraintSet(set: ConstraintSet!)

Sets a ConstraintSet object to manage constraints.

Unit setDesignInformation(type: Int, value1: Any!, value2: Any!) Unit setId(id: Int) Unit setMaxHeight(value: Int)

Set the max height for this view

Unit setMaxWidth(value: Int)

Set the max width for this view

Unit setMinHeight(value: Int)

Set the min height for this view

Unit setMinWidth(value: Int)

Set the min width for this view

Unit setOnConstraintsChanged(    constraintsChangedListener: ConstraintsChangedListener!)

Notify of constraints changed

Unit setOptimizationLevel(level: Int)

Set the optimization for the layout resolution.

Unit setState(id: Int, screenWidth: Int, screenHeight: Int)

Set the State of the ConstraintLayout, causing it to load a particular ConstraintSet.

Boolean shouldDelayChildPressedState() Protected functions Unit applyConstraintsFromLayoutParams(    isInEditMode: Boolean,    child: View!,    widget: ConstraintWidget!,    layoutParams: ConstraintLayout.LayoutParams!,    idToWidget: SparseArray!) Boolean checkLayoutParams(p: ViewGroup.LayoutParams!) Unit dispatchDraw(canvas: Canvas!) Boolean dynamicUpdateConstraints(widthMeasureSpec: Int, heightMeasureSpec: Int)

This can be overridden to change the way Modifiers are used.

ConstraintLayout.LayoutParams! generateDefaultLayoutParams() ViewGroup.LayoutParams! generateLayoutParams(p: ViewGroup.LayoutParams!) Boolean isRtl() Unit onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int) Unit onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) Unit parseLayoutDescription(id: Int)

Subclasses can override the handling of layoutDescription

Unit resolveMeasuredDimension(    widthMeasureSpec: Int,    heightMeasureSpec: Int,    measuredWidth: Int,    measuredHeight: Int,    isWidthMeasuredTooSmall: Boolean,    isHeightMeasuredTooSmall: Boolean)

Handles calling setMeasuredDimension()

Unit resolveSystem(    layout: ConstraintWidgetContainer!,    optimizationLevel: Int,    widthMeasureSpec: Int,    heightMeasureSpec: Int)

Handles measuring a layout

Unit setSelfDimensionBehaviour(    layout: ConstraintWidgetContainer!,    widthMode: Int,    widthSize: Int,    heightMode: Int,    heightSize: Int) Protected properties ConstraintLayoutStates! mConstraintLayoutSpec Boolean mDirtyHierarchy ConstraintWidgetContainer! mLayoutWidget Inherited Constants From android.view.View const Int ACCESSIBILITY_DATA_SENSITIVE_AUTO = 0 const Int ACCESSIBILITY_DATA_SENSITIVE_NO = 2 const Int ACCESSIBILITY_DATA_SENSITIVE_YES = 1 const Int ACCESSIBILITY_LIVE_REGION_ASSERTIVE = 2 const Int ACCESSIBILITY_LIVE_REGION_NONE = 0 const Int ACCESSIBILITY_LIVE_REGION_POLITE = 1 const Property! ALPHA const Int AUTOFILL_FLAG_INCLUDE_NOT_IMPORTANT_VIEWS = 1 const String! AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE = "creditCardExpirationDate" const String! AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DAY = "creditCardExpirationDay" const String! AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_MONTH = "creditCardExpirationMonth" const String! AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_YEAR = "creditCardExpirationYear" const String! AUTOFILL_HINT_CREDIT_CARD_NUMBER = "creditCardNumber" const String! AUTOFILL_HINT_CREDIT_CARD_SECURITY_CODE = "creditCardSecurityCode" const String! AUTOFILL_HINT_EMAIL_ADDRESS = "emailAddress" const String! AUTOFILL_HINT_NAME = "name" const String! AUTOFILL_HINT_PASSWORD = "password" const String! AUTOFILL_HINT_PHONE = "phone" const String! AUTOFILL_HINT_POSTAL_ADDRESS = "postalAddress" const String! AUTOFILL_HINT_POSTAL_CODE = "postalCode" const String! AUTOFILL_HINT_USERNAME = "username" const Int AUTOFILL_TYPE_DATE = 4 const Int AUTOFILL_TYPE_LIST = 3 const Int AUTOFILL_TYPE_NONE = 0 const Int AUTOFILL_TYPE_TEXT = 1 const Int AUTOFILL_TYPE_TOGGLE = 2 const Int DRAG_FLAG_ACCESSIBILITY_ACTION = 1024 const Int DRAG_FLAG_GLOBAL = 256 const Int DRAG_FLAG_GLOBAL_PERSISTABLE_URI_PERMISSION = 64 const Int DRAG_FLAG_GLOBAL_PREFIX_URI_PERMISSION = 128 const Int DRAG_FLAG_GLOBAL_URI_READ = 1 const Int DRAG_FLAG_GLOBAL_URI_WRITE = 2 const Int DRAG_FLAG_OPAQUE = 512 const Int DRAWING_CACHE_QUALITY_AUTO = 0

This property is deprecated.

const Int DRAWING_CACHE_QUALITY_HIGH = 1048576

This property is deprecated.

const Int DRAWING_CACHE_QUALITY_LOW = 524288

This property is deprecated.

const IntArray! EMPTY_STATE_SET const IntArray! ENABLED_FOCUSED_SELECTED_STATE_SET const IntArray! ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET const IntArray! ENABLED_FOCUSED_STATE_SET const IntArray! ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET const IntArray! ENABLED_SELECTED_STATE_SET const IntArray! ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET const IntArray! ENABLED_STATE_SET const IntArray! ENABLED_WINDOW_FOCUSED_STATE_SET const Int FIND_VIEWS_WITH_CONTENT_DESCRIPTION = 2 const Int FIND_VIEWS_WITH_TEXT = 1 const Int FOCUSABLE = 1 const Int FOCUSABLES_ALL = 0 const Int FOCUSABLES_TOUCH_MODE = 1 const Int FOCUSABLE_AUTO = 16 const IntArray! FOCUSED_SELECTED_STATE_SET const IntArray! FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET const IntArray! FOCUSED_STATE_SET const IntArray! FOCUSED_WINDOW_FOCUSED_STATE_SET const Int FOCUS_BACKWARD = 1 const Int FOCUS_DOWN = 130 const Int FOCUS_FORWARD = 2 const Int FOCUS_LEFT = 17 const Int FOCUS_RIGHT = 66 const Int FOCUS_UP = 33 const Int GONE = 8 const Int HAPTIC_FEEDBACK_ENABLED = 268435456 const Int IMPORTANT_FOR_ACCESSIBILITY_AUTO = 0 const Int IMPORTANT_FOR_ACCESSIBILITY_NO = 2 const Int IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS = 4 const Int IMPORTANT_FOR_ACCESSIBILITY_YES = 1 const Int IMPORTANT_FOR_AUTOFILL_AUTO = 0 const Int IMPORTANT_FOR_AUTOFILL_NO = 2 const Int IMPORTANT_FOR_AUTOFILL_NO_EXCLUDE_DESCENDANTS = 8 const Int IMPORTANT_FOR_AUTOFILL_YES = 1 const Int IMPORTANT_FOR_AUTOFILL_YES_EXCLUDE_DESCENDANTS = 4 const Int IMPORTANT_FOR_CONTENT_CAPTURE_AUTO = 0 const Int IMPORTANT_FOR_CONTENT_CAPTURE_NO = 2 const Int IMPORTANT_FOR_CONTENT_CAPTURE_NO_EXCLUDE_DESCENDANTS = 8 const Int IMPORTANT_FOR_CONTENT_CAPTURE_YES = 1 const Int IMPORTANT_FOR_CONTENT_CAPTURE_YES_EXCLUDE_DESCENDANTS = 4 const Int INVISIBLE = 4 const Int KEEP_SCREEN_ON = 67108864 const Int LAYER_TYPE_HARDWARE = 2 const Int LAYER_TYPE_NONE = 0 const Int LAYER_TYPE_SOFTWARE = 1 const Int LAYOUT_DIRECTION_INHERIT = 2 const Int LAYOUT_DIRECTION_LOCALE = 3 const Int LAYOUT_DIRECTION_LTR = 0 const Int LAYOUT_DIRECTION_RTL = 1 const Int MEASURED_HEIGHT_STATE_SHIFT = 16 const Int MEASURED_SIZE_MASK = 16777215 const Int MEASURED_STATE_MASK = -16777216 const Int MEASURED_STATE_TOO_SMALL = 16777216 const Int NOT_FOCUSABLE = 0 const Int NO_ID = -1 const Int OVER_SCROLL_ALWAYS = 0 const Int OVER_SCROLL_IF_CONTENT_SCROLLS = 1 const Int OVER_SCROLL_NEVER = 2 const IntArray! PRESSED_ENABLED_FOCUSED_SELECTED_STATE_SET const IntArray! PRESSED_ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET const IntArray! PRESSED_ENABLED_FOCUSED_STATE_SET const IntArray! PRESSED_ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET const IntArray! PRESSED_ENABLED_SELECTED_STATE_SET const IntArray! PRESSED_ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET const IntArray! PRESSED_ENABLED_STATE_SET const IntArray! PRESSED_ENABLED_WINDOW_FOCUSED_STATE_SET const IntArray! PRESSED_FOCUSED_SELECTED_STATE_SET const IntArray! PRESSED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET const IntArray! PRESSED_FOCUSED_STATE_SET const IntArray! PRESSED_FOCUSED_WINDOW_FOCUSED_STATE_SET const IntArray! PRESSED_SELECTED_STATE_SET const IntArray! PRESSED_SELECTED_WINDOW_FOCUSED_STATE_SET const IntArray! PRESSED_STATE_SET const IntArray! PRESSED_WINDOW_FOCUSED_STATE_SET const Property! ROTATION const Property! ROTATION_X const Property! ROTATION_Y const Property! SCALE_X const Property! SCALE_Y const Int SCREEN_STATE_OFF = 0 const Int SCREEN_STATE_ON = 1 const Int SCROLLBARS_INSIDE_INSET = 16777216 const Int SCROLLBARS_INSIDE_OVERLAY = 0 const Int SCROLLBARS_OUTSIDE_INSET = 50331648 const Int SCROLLBARS_OUTSIDE_OVERLAY = 33554432 const Int SCROLLBAR_POSITION_DEFAULT = 0 const Int SCROLLBAR_POSITION_LEFT = 1 const Int SCROLLBAR_POSITION_RIGHT = 2 const Int SCROLL_AXIS_HORIZONTAL = 1 const Int SCROLL_AXIS_NONE = 0 const Int SCROLL_AXIS_VERTICAL = 2 const Int SCROLL_CAPTURE_HINT_AUTO = 0 const Int SCROLL_CAPTURE_HINT_EXCLUDE = 1 const Int SCROLL_CAPTURE_HINT_EXCLUDE_DESCENDANTS = 4 const Int SCROLL_CAPTURE_HINT_INCLUDE = 2 const Int SCROLL_INDICATOR_BOTTOM = 2 const Int SCROLL_INDICATOR_END = 32 const Int SCROLL_INDICATOR_LEFT = 4 const Int SCROLL_INDICATOR_RIGHT = 8 const Int SCROLL_INDICATOR_START = 16 const Int SCROLL_INDICATOR_TOP = 1 const IntArray! SELECTED_STATE_SET const IntArray! SELECTED_WINDOW_FOCUSED_STATE_SET const Int SOUND_EFFECTS_ENABLED = 134217728 const Int STATUS_BAR_HIDDEN = 1

This property is deprecated.

const Int STATUS_BAR_VISIBLE = 0

This property is deprecated.

const Int SYSTEM_UI_FLAG_FULLSCREEN = 4

This property is deprecated.

const Int SYSTEM_UI_FLAG_HIDE_NAVIGATION = 2

This property is deprecated.

const Int SYSTEM_UI_FLAG_IMMERSIVE = 2048

This property is deprecated.

const Int SYSTEM_UI_FLAG_IMMERSIVE_STICKY = 4096

This property is deprecated.

const Int SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN = 1024

This property is deprecated.

const Int SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION = 512

This property is deprecated.

const Int SYSTEM_UI_FLAG_LAYOUT_STABLE = 256

This property is deprecated.

const Int SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR = 16

This property is deprecated.

const Int SYSTEM_UI_FLAG_LIGHT_STATUS_BAR = 8192

This property is deprecated.

const Int SYSTEM_UI_FLAG_LOW_PROFILE = 1

This property is deprecated.

const Int SYSTEM_UI_FLAG_VISIBLE = 0

This property is deprecated.

const Int SYSTEM_UI_LAYOUT_FLAGS = 1536

This property is deprecated.

const Int TEXT_ALIGNMENT_CENTER = 4 const Int TEXT_ALIGNMENT_GRAVITY = 1 const Int TEXT_ALIGNMENT_INHERIT = 0 const Int TEXT_ALIGNMENT_TEXT_END = 3 const Int TEXT_ALIGNMENT_TEXT_START = 2 const Int TEXT_ALIGNMENT_VIEW_END = 6 const Int TEXT_ALIGNMENT_VIEW_START = 5 const Int TEXT_DIRECTION_ANY_RTL = 2 const Int TEXT_DIRECTION_FIRST_STRONG = 1 const Int TEXT_DIRECTION_FIRST_STRONG_LTR = 6 const Int TEXT_DIRECTION_FIRST_STRONG_RTL = 7 const Int TEXT_DIRECTION_INHERIT = 0 const Int TEXT_DIRECTION_LOCALE = 5 const Int TEXT_DIRECTION_LTR = 3 const Int TEXT_DIRECTION_RTL = 4 const Property! TRANSLATION_X const Property! TRANSLATION_Y const Property! TRANSLATION_Z const String! VIEW_LOG_TAG = "View" const Int VISIBLE = 0 const IntArray! WINDOW_FOCUSED_STATE_SET const Property! X const Property! Y const Property! Z From android.view.ViewGroup const Int CLIP_TO_PADDING_MASK = 34 const Int FOCUS_AFTER_DESCENDANTS = 262144 const Int FOCUS_BEFORE_DESCENDANTS = 131072 const Int FOCUS_BLOCK_DESCENDANTS = 393216 const Int LAYOUT_MODE_CLIP_BOUNDS = 0 const Int LAYOUT_MODE_OPTICAL_BOUNDS = 1 const Int PERSISTENT_ALL_CACHES = 3

This property is deprecated.

const Int PERSISTENT_ANIMATION_CACHE = 1

This property is deprecated.

const Int PERSISTENT_NO_CACHE = 0

This property is deprecated.

const Int PERSISTENT_SCROLLING_CACHE = 2

This property is deprecated.

Inherited functions From android.view.View Unit addOnAttachStateChangeListener(    listener: View.OnAttachStateChangeListener!) Unit addOnLayoutChangeListener(listener: View.OnLayoutChangeListener!) Unit addOnUnhandledKeyEventListener(    listener: View.OnUnhandledKeyEventListener!) ViewPropertyAnimator! animate() Unit announceForAccessibility(text: CharSequence!) Unit autofill(value: AutofillValue!) Boolean awakenScrollBars() Unit bringToFront() Unit buildDrawingCache()

This function is deprecated.

Unit buildLayer() Boolean callOnClick() Boolean canResolveLayoutDirection() Boolean canResolveTextAlignment() Boolean canResolveTextDirection() Boolean canScrollHorizontally(direction: Int) Boolean canScrollVertically(direction: Int) Unit cancelDragAndDrop() Unit cancelLongPress() Unit cancelPendingInputEvents() Boolean checkInputConnectionProxy(view: View!) Unit clearAnimation() Unit clearViewTranslationCallback() java-static Int combineMeasuredStates(curState: Int, newState: Int) Int computeHorizontalScrollExtent() Int computeHorizontalScrollOffset() Int computeHorizontalScrollRange() Unit computeScroll() WindowInsets! computeSystemWindowInsets(in: WindowInsets!, outLocalInsets: Rect!) Int computeVerticalScrollExtent() Int computeVerticalScrollOffset() Int computeVerticalScrollRange() AccessibilityNodeInfo! createAccessibilityNodeInfo() Unit createContextMenu(menu: ContextMenu!) Unit destroyDrawingCache()

This function is deprecated.

Boolean dispatchGenericMotionEvent(event: MotionEvent!) Boolean dispatchNestedFling(velocityX: Float, velocityY: Float, consumed: Boolean) Boolean dispatchNestedPreFling(velocityX: Float, velocityY: Float) Boolean dispatchNestedPrePerformAccessibilityAction(    action: Int,    arguments: Bundle!) Boolean dispatchNestedPreScroll(    dx: Int,    dy: Int,    consumed: IntArray!,    offsetInWindow: IntArray!) Boolean dispatchNestedScroll(    dxConsumed: Int,    dyConsumed: Int,    dxUnconsumed: Int,    dyUnconsumed: Int,    offsetInWindow: IntArray!) Boolean dispatchPopulateAccessibilityEvent(event: AccessibilityEvent!) Unit draw(canvas: Canvas!) Unit drawableHotspotChanged(x: Float, y: Float) OnBackInvokedDispatcher! findOnBackInvokedDispatcher() T! findViewById(id: Int) T! findViewWithTag(tag: Any!) Boolean fitSystemWindows(insets: Rect!)

This function is deprecated.

Unit forceHasOverlappingRendering(hasOverlappingRendering: Boolean) Unit generateDisplayHash(    hashAlgorithm: String!,    bounds: Rect!,    executor: Executor!,    callback: DisplayHashResultCallback!) java-static Int generateViewId() View.AccessibilityDelegate! getAccessibilityDelegate() Int getAccessibilityLiveRegion() AccessibilityNodeProvider! getAccessibilityNodeProvider() CharSequence! getAccessibilityPaneTitle() Int getAccessibilityTraversalAfter() Int getAccessibilityTraversalBefore() String! getAllowedHandwritingDelegatePackageName() String! getAllowedHandwritingDelegatorPackageName() Float getAlpha() Animation! getAnimation() Matrix! getAnimationMatrix() IBinder! getApplicationWindowToken() IntArray! getAttributeResolutionStack(attribute: Int) (Mutable)Map! getAttributeSourceResourceMap() Array! getAutofillHints() AutofillId! getAutofillId() Int getAutofillType() AutofillValue! getAutofillValue() Drawable! getBackground() BlendMode! getBackgroundTintBlendMode() ColorStateList! getBackgroundTintList() PorterDuff.Mode! getBackgroundTintMode() Int getBaseline() Int getBottom() Float getBottomFadingEdgeStrength() Int getBottomPaddingOffset() Float getCameraDistance() Rect! getClipBounds() Boolean getClipBounds(outRect: Rect!) Boolean getClipToOutline() ContentCaptureSession! getContentCaptureSession() CharSequence! getContentDescription() Context! getContext() ContextMenu.ContextMenuInfo! getContextMenuInfo() Boolean getDefaultFocusHighlightEnabled() java-static Int getDefaultSize(size: Int, measureSpec: Int) Display! getDisplay() IntArray! getDrawableState() Bitmap! getDrawingCache()

This function is deprecated.

Int getDrawingCacheBackgroundColor()

This function is deprecated.

Int getDrawingCacheQuality()

This function is deprecated.

Unit getDrawingRect(outRect: Rect!) Long getDrawingTime() Float getElevation() Int getExplicitStyle() Boolean getFilterTouchesWhenObscured() Boolean getFitsSystemWindows() Int getFocusable() ArrayList! getFocusables(direction: Int) Unit getFocusedRect(r: Rect!) Drawable! getForeground() Int getForegroundGravity() BlendMode! getForegroundTintBlendMode() ColorStateList! getForegroundTintList() PorterDuff.Mode! getForegroundTintMode() Boolean getGlobalVisibleRect(r: Rect!, globalOffset: Point!) Handler! getHandler() Float getHandwritingBoundsOffsetBottom() Float getHandwritingBoundsOffsetLeft() Float getHandwritingBoundsOffsetRight() Float getHandwritingBoundsOffsetTop() Runnable! getHandwritingDelegatorCallback() Boolean getHasOverlappingRendering() Int getHeight() Unit getHitRect(outRect: Rect!) Int getHorizontalFadingEdgeLength() Int getHorizontalScrollbarHeight() Drawable! getHorizontalScrollbarThumbDrawable() Drawable! getHorizontalScrollbarTrackDrawable() Int getId() Int getImportantForAccessibility() Int getImportantForAutofill() Int getImportantForContentCapture() Boolean getKeepScreenOn() KeyEvent.DispatcherState! getKeyDispatcherState() Int getLabelFor() Int getLayerType() Int getLayoutDirection() ViewGroup.LayoutParams! getLayoutParams() Int getLeft() Float getLeftFadingEdgeStrength() Int getLeftPaddingOffset() Boolean getLocalVisibleRect(r: Rect!) Unit getLocationInSurface(location: IntArray!) Unit getLocationInWindow(outLocation: IntArray!) Unit getLocationOnScreen(outLocation: IntArray!) Matrix! getMatrix() Int getMeasuredHeight() Int getMeasuredHeightAndState() Int getMeasuredState() Int getMeasuredWidth() Int getMeasuredWidthAndState() Int getMinimumHeight() Int getMinimumWidth() Int getNextClusterForwardId() Int getNextFocusDownId() Int getNextFocusForwardId() Int getNextFocusLeftId() Int getNextFocusRightId() Int getNextFocusUpId() View.OnFocusChangeListener! getOnFocusChangeListener() Int getOutlineAmbientShadowColor() ViewOutlineProvider! getOutlineProvider() Int getOutlineSpotShadowColor() Int getOverScrollMode() ViewOverlay! getOverlay() Int getPaddingBottom() Int getPaddingEnd() Int getPaddingLeft() Int getPaddingRight() Int getPaddingStart() Int getPaddingTop() ViewParent! getParent() ViewParent! getParentForAccessibility() Float getPivotX() Float getPivotY() PointerIcon! getPointerIcon() (Mutable)List! getPreferKeepClearRects() Array! getReceiveContentMimeTypes() Resources! getResources() Boolean getRevealOnFocusHint() Int getRight() Float getRightFadingEdgeStrength() Int getRightPaddingOffset() AttachedSurfaceControl! getRootSurfaceControl() View! getRootView() WindowInsets! getRootWindowInsets() Float getRotation() Float getRotationX() Float getRotationY() Float getScaleX() Float getScaleY() Int getScrollBarDefaultDelayBeforeFade() Int getScrollBarFadeDuration() Int getScrollBarSize() Int getScrollBarStyle() Int getScrollCaptureHint() Int getScrollIndicators() Int getScrollX() Int getScrollY() Int getSolidColor() Int getSourceLayoutResId() CharSequence! getStateDescription() StateListAnimator! getStateListAnimator() Int getSuggestedMinimumHeight() Int getSuggestedMinimumWidth() (Mutable)List! getSystemGestureExclusionRects() Int getSystemUiVisibility()

This function is deprecated.

Any! getTag() Int getTextAlignment() Int getTextDirection() CharSequence! getTooltipText() Int getTop() Float getTopFadingEdgeStrength() Int getTopPaddingOffset() TouchDelegate! getTouchDelegate() ArrayList! getTouchables() Float getTransitionAlpha() String! getTransitionName() Float getTranslationX() Float getTranslationY() Float getTranslationZ() Long getUniqueDrawingId() Int getVerticalFadingEdgeLength() Int getVerticalScrollbarPosition() Drawable! getVerticalScrollbarThumbDrawable() Drawable! getVerticalScrollbarTrackDrawable() Int getVerticalScrollbarWidth() ViewTranslationResponse! getViewTranslationResponse() ViewTreeObserver! getViewTreeObserver() Int getVisibility() Int getWidth() Int getWindowAttachCount() WindowId! getWindowId() WindowInsetsController! getWindowInsetsController() Int getWindowSystemUiVisibility()

This function is deprecated.

IBinder! getWindowToken() Int getWindowVisibility() Unit getWindowVisibleDisplayFrame(outRect: Rect!) Float getX() Float getY() Float getZ() Boolean hasExplicitFocusable() Boolean hasFocusable() Boolean hasNestedScrollingParent() Boolean hasOnClickListeners() Boolean hasOnLongClickListeners() Boolean hasOverlappingRendering() Boolean hasPointerCapture() Boolean hasWindowFocus() java-static View! inflate(context: Context!, resource: Int, root: ViewGroup!) Unit invalidate(dirty: Rect!)

This function is deprecated.

Unit invalidateDrawable(drawable: Drawable!) Unit invalidateOutline() Boolean isAccessibilityDataSensitive() Boolean isAccessibilityFocused() Boolean isAccessibilityHeading() Boolean isActivated() Boolean isAttachedToWindow() Boolean isAutoHandwritingEnabled() Boolean isClickable() Boolean isContextClickable() Boolean isCredential() Boolean isDirty() Boolean isDrawingCacheEnabled()

This function is deprecated.

Boolean isDuplicateParentStateEnabled() Boolean isEnabled() Boolean isFocusable() Boolean isFocusableInTouchMode() Boolean isFocused() Boolean isFocusedByDefault() Boolean isForceDarkAllowed() Boolean isHandwritingDelegate() Boolean isHapticFeedbackEnabled() Boolean isHardwareAccelerated() Boolean isHorizontalFadingEdgeEnabled() Boolean isHorizontalScrollBarEnabled() Boolean isHovered() Boolean isImportantForAccessibility() Boolean isImportantForAutofill() Boolean isImportantForContentCapture() Boolean isInEditMode() Boolean isInLayout() Boolean isInTouchMode() Boolean isKeyboardNavigationCluster() Boolean isLaidOut() Boolean isLayoutDirectionResolved() Boolean isLayoutRequested() Boolean isLongClickable() Boolean isNestedScrollingEnabled() Boolean isOpaque() Boolean isPaddingOffsetRequired() Boolean isPaddingRelative() Boolean isPivotSet() Boolean isPreferKeepClear() Boolean isPressed() Boolean isSaveEnabled() Boolean isSaveFromParentEnabled() Boolean isScreenReaderFocusable() Boolean isScrollContainer() Boolean isScrollbarFadingEnabled() Boolean isSelected() Boolean isShowingLayoutBounds() Boolean isShown() Boolean isSoundEffectsEnabled() Boolean isTemporarilyDetached() Boolean isTextAlignmentResolved() Boolean isTextDirectionResolved() Boolean isVerticalFadingEdgeEnabled() Boolean isVerticalScrollBarEnabled() Boolean isVisibleToUserForAutofill(virtualId: Int) View! keyboardNavigationClusterSearch(currentCluster: View!, direction: Int) Unit measure(widthMeasureSpec: Int, heightMeasureSpec: Int) java-static IntArray! mergeDrawableStates(baseState: IntArray!, additionalState: IntArray!) Unit offsetLeftAndRight(offset: Int) Unit offsetTopAndBottom(offset: Int) Unit onAnimationEnd() Unit onAnimationStart() WindowInsets! onApplyWindowInsets(insets: WindowInsets!) Unit onCancelPendingInputEvents() Boolean onCapturedPointerEvent(event: MotionEvent!) Boolean onCheckIsTextEditor() Unit onConfigurationChanged(newConfig: Configuration!) Unit onCreateContextMenu(menu: ContextMenu!) InputConnection! onCreateInputConnection(outAttrs: EditorInfo!) Unit onCreateViewTranslationRequest(    supportedFormats: IntArray!,    requestsCollector: Consumer!) Unit onCreateVirtualViewTranslationRequests(    virtualIds: LongArray!,    supportedFormats: IntArray!,    requestsCollector: Consumer!) Unit onDisplayHint(hint: Int) Boolean onDragEvent(event: DragEvent!) Unit onDraw(canvas: Canvas!) Unit onDrawForeground(canvas: Canvas!) Unit onDrawScrollBars(canvas: Canvas!) Boolean onFilterTouchEventForSecurity(event: MotionEvent!) Unit onFinishInflate() Unit onFinishTemporaryDetach() Unit onFocusChanged(    gainFocus: Boolean,    direction: Int,    previouslyFocusedRect: Rect!) Boolean onGenericMotionEvent(event: MotionEvent!) Unit onHoverChanged(hovered: Boolean) Boolean onHoverEvent(event: MotionEvent!) Unit onInitializeAccessibilityEvent(event: AccessibilityEvent!) Unit onInitializeAccessibilityNodeInfo(info: AccessibilityNodeInfo!) Boolean onKeyDown(keyCode: Int, event: KeyEvent!) Boolean onKeyLongPress(keyCode: Int, event: KeyEvent!) Boolean onKeyMultiple(keyCode: Int, repeatCount: Int, event: KeyEvent!) Boolean onKeyPreIme(keyCode: Int, event: KeyEvent!) Boolean onKeyShortcut(keyCode: Int, event: KeyEvent!) Boolean onKeyUp(keyCode: Int, event: KeyEvent!) Unit onOverScrolled(    scrollX: Int,    scrollY: Int,    clampedX: Boolean,    clampedY: Boolean) Unit onPointerCaptureChange(hasCapture: Boolean) Unit onPopulateAccessibilityEvent(event: AccessibilityEvent!) Unit onProvideAutofillStructure(structure: ViewStructure!, flags: Int) Unit onProvideAutofillVirtualStructure(structure: ViewStructure!, flags: Int) Unit onProvideContentCaptureStructure(structure: ViewStructure!, flags: Int) Unit onProvideStructure(structure: ViewStructure!) Unit onProvideVirtualStructure(structure: ViewStructure!) ContentInfo! onReceiveContent(payload: ContentInfo!) Unit onRestoreInstanceState(state: Parcelable!) Unit onRtlPropertiesChanged(layoutDirection: Int) Parcelable! onSaveInstanceState() Unit onScreenStateChanged(screenState: Int) Unit onScrollCaptureSearch(    localVisibleRect: Rect!,    windowOffset: Point!,    targets: Consumer!) Unit onScrollChanged(l: Int, t: Int, oldl: Int, oldt: Int) Boolean onSetAlpha(alpha: Int) Unit onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) Unit onStartTemporaryDetach() Boolean onTouchEvent(event: MotionEvent!) Boolean onTrackballEvent(event: MotionEvent!) Unit onViewTranslationResponse(response: ViewTranslationResponse!) Unit onVirtualViewTranslationResponses(    response: LongSparseArray!) Unit onVisibilityAggregated(isVisible: Boolean) Unit onVisibilityChanged(changedView: View!, visibility: Int) Unit onWindowFocusChanged(hasWindowFocus: Boolean) Unit onWindowSystemUiVisibilityChanged(visible: Int)

This function is deprecated.

Unit onWindowVisibilityChanged(visibility: Int) Boolean overScrollBy(    deltaX: Int,    deltaY: Int,    scrollX: Int,    scrollY: Int,    scrollRangeX: Int,    scrollRangeY: Int,    maxOverScrollX: Int,    maxOverScrollY: Int,    isTouchEvent: Boolean) Boolean performAccessibilityAction(action: Int, arguments: Bundle!) Boolean performClick() Boolean performContextClick(x: Float, y: Float) Boolean performHapticFeedback(feedbackConstant: Int) Boolean performLongClick() ContentInfo! performReceiveContent(payload: ContentInfo!) Unit playSoundEffect(soundConstant: Int) Boolean post(action: Runnable!) Boolean postDelayed(action: Runnable!, delayMillis: Long) Unit postInvalidate() Unit postInvalidateDelayed(delayMilliseconds: Long) Unit postInvalidateOnAnimation() Unit postOnAnimation(action: Runnable!) Unit postOnAnimationDelayed(action: Runnable!, delayMillis: Long) Unit refreshDrawableState() Unit releasePointerCapture() Boolean removeCallbacks(action: Runnable!) Unit removeOnAttachStateChangeListener(    listener: View.OnAttachStateChangeListener!) Unit removeOnLayoutChangeListener(listener: View.OnLayoutChangeListener!) Unit removeOnUnhandledKeyEventListener(    listener: View.OnUnhandledKeyEventListener!) Unit requestApplyInsets() Unit requestFitSystemWindows()

This function is deprecated.

Boolean requestFocusFromTouch() Unit requestPointerCapture() Boolean requestRectangleOnScreen(rectangle: Rect!) Unit requestUnbufferedDispatch(event: MotionEvent!) T! requireViewById(id: Int) Unit resetPivot() java-static Int resolveSize(size: Int, measureSpec: Int) java-static Int resolveSizeAndState(size: Int, measureSpec: Int, childMeasuredState: Int) Unit restoreHierarchyState(container: SparseArray!) Unit saveAttributeDataForStyleable(    context: Context!,    styleable: IntArray!,    attrs: AttributeSet!,    t: TypedArray!,    defStyleAttr: Int,    defStyleRes: Int) Unit saveHierarchyState(container: SparseArray!) Unit scheduleDrawable(who: Drawable!, what: Runnable!, when: Long) Unit scrollBy(x: Int, y: Int) Unit scrollTo(x: Int, y: Int) Unit sendAccessibilityEvent(eventType: Int) Unit sendAccessibilityEventUnchecked(event: AccessibilityEvent!) Unit setAccessibilityDataSensitive(accessibilityDataSensitive: Int) Unit setAccessibilityDelegate(delegate: View.AccessibilityDelegate!) Unit setAccessibilityHeading(isHeading: Boolean) Unit setAccessibilityLiveRegion(mode: Int) Unit setAccessibilityPaneTitle(accessibilityPaneTitle: CharSequence!) Unit setAccessibilityTraversalAfter(afterId: Int) Unit setAccessibilityTraversalBefore(beforeId: Int) Unit setActivated(activated: Boolean) Unit setAllowClickWhenDisabled(clickableWhenDisabled: Boolean) Unit setAllowedHandwritingDelegatePackage(allowedPackageName: String!) Unit setAllowedHandwritingDelegatorPackage(allowedPackageName: String!) Unit setAlpha(alpha: Float) Unit setAnimation(animation: Animation!) Unit setAnimationMatrix(matrix: Matrix!) Unit setAutoHandwritingEnabled(enabled: Boolean) Unit setAutofillHints(autofillHints: Array!) Unit setAutofillId(id: AutofillId!) Unit setBackground(background: Drawable!) Unit setBackgroundColor(color: Int) Unit setBackgroundDrawable(background: Drawable!)

This function is deprecated.

Unit setBackgroundResource(resid: Int) Unit setBackgroundTintBlendMode(blendMode: BlendMode!) Unit setBackgroundTintList(tint: ColorStateList!) Unit setBackgroundTintMode(tintMode: PorterDuff.Mode!) Unit setBottom(bottom: Int) Unit setCameraDistance(distance: Float) Unit setClickable(clickable: Boolean) Unit setClipBounds(clipBounds: Rect!) Unit setClipToOutline(clipToOutline: Boolean) Unit setContentCaptureSession(contentCaptureSession: ContentCaptureSession!) Unit setContentDescription(contentDescription: CharSequence!) Unit setContextClickable(contextClickable: Boolean) Unit setDefaultFocusHighlightEnabled(defaultFocusHighlightEnabled: Boolean) Unit setDrawingCacheBackgroundColor(color: Int)

This function is deprecated.

Unit setDrawingCacheEnabled(enabled: Boolean)

This function is deprecated.

Unit setDrawingCacheQuality(quality: Int)

This function is deprecated.

Unit setDuplicateParentStateEnabled(enabled: Boolean) Unit setElevation(elevation: Float) Unit setEnabled(enabled: Boolean) Unit setFadingEdgeLength(length: Int) Unit setFilterTouchesWhenObscured(enabled: Boolean) Unit setFitsSystemWindows(fitSystemWindows: Boolean) Unit setFocusable(focusable: Boolean) Unit setFocusableInTouchMode(focusableInTouchMode: Boolean) Unit setFocusedByDefault(isFocusedByDefault: Boolean) Unit setForceDarkAllowed(allow: Boolean) Unit setForeground(foreground: Drawable!) Unit setForegroundGravity(gravity: Int) Unit setForegroundTintBlendMode(blendMode: BlendMode!) Unit setForegroundTintList(tint: ColorStateList!) Unit setForegroundTintMode(tintMode: PorterDuff.Mode!) Unit setHandwritingBoundsOffsets(    offsetLeft: Float,    offsetTop: Float,    offsetRight: Float,    offsetBottom: Float) Unit setHandwritingDelegatorCallback(callback: Runnable!) Unit setHapticFeedbackEnabled(hapticFeedbackEnabled: Boolean) Unit setHasTransientState(hasTransientState: Boolean) Unit setHorizontalFadingEdgeEnabled(horizontalFadingEdgeEnabled: Boolean) Unit setHorizontalScrollBarEnabled(horizontalScrollBarEnabled: Boolean) Unit setHorizontalScrollbarThumbDrawable(drawable: Drawable!) Unit setHorizontalScrollbarTrackDrawable(drawable: Drawable!) Unit setHovered(hovered: Boolean) Unit setImportantForAccessibility(mode: Int) Unit setImportantForAutofill(mode: Int) Unit setImportantForContentCapture(mode: Int) Unit setIsCredential(isCredential: Boolean) Unit setIsHandwritingDelegate(isHandwritingDelegate: Boolean) Unit setKeepScreenOn(keepScreenOn: Boolean) Unit setKeyboardNavigationCluster(isCluster: Boolean) Unit setLabelFor(id: Int) Unit setLayerPaint(paint: Paint!) Unit setLayerType(layerType: Int, paint: Paint!) Unit setLayoutDirection(layoutDirection: Int) Unit setLayoutParams(params: ViewGroup.LayoutParams!) Unit setLeft(left: Int) Unit setLeftTopRightBottom(left: Int, top: Int, right: Int, bottom: Int) Unit setLongClickable(longClickable: Boolean) Unit setMeasuredDimension(measuredWidth: Int, measuredHeight: Int) Unit setMinimumHeight(minHeight: Int) Unit setMinimumWidth(minWidth: Int) Unit setNestedScrollingEnabled(enabled: Boolean) Unit setNextClusterForwardId(nextClusterForwardId: Int) Unit setNextFocusDownId(nextFocusDownId: Int) Unit setNextFocusForwardId(nextFocusForwardId: Int) Unit setNextFocusLeftId(nextFocusLeftId: Int) Unit setNextFocusRightId(nextFocusRightId: Int) Unit setNextFocusUpId(nextFocusUpId: Int) Unit setOnApplyWindowInsetsListener(    listener: View.OnApplyWindowInsetsListener!) Unit setOnCapturedPointerListener(l: View.OnCapturedPointerListener!) Unit setOnClickListener(l: View.OnClickListener!) Unit setOnContextClickListener(l: View.OnContextClickListener!) Unit setOnCreateContextMenuListener(l: View.OnCreateContextMenuListener!) Unit setOnDragListener(l: View.OnDragListener!) Unit setOnFocusChangeListener(l: View.OnFocusChangeListener!) Unit setOnGenericMotionListener(l: View.OnGenericMotionListener!) Unit setOnHoverListener(l: View.OnHoverListener!) Unit setOnKeyListener(l: View.OnKeyListener!) Unit setOnLongClickListener(l: View.OnLongClickListener!) Unit setOnReceiveContentListener(    mimeTypes: Array!,    listener: OnReceiveContentListener!) Unit setOnScrollChangeListener(l: View.OnScrollChangeListener!) Unit setOnSystemUiVisibilityChangeListener(    l: View.OnSystemUiVisibilityChangeListener!)

This function is deprecated.

Unit setOnTouchListener(l: View.OnTouchListener!) Unit setOutlineAmbientShadowColor(color: Int) Unit setOutlineProvider(provider: ViewOutlineProvider!) Unit setOutlineSpotShadowColor(color: Int) Unit setOverScrollMode(overScrollMode: Int) Unit setPadding(left: Int, top: Int, right: Int, bottom: Int) Unit setPaddingRelative(start: Int, top: Int, end: Int, bottom: Int) Unit setPivotX(pivotX: Float) Unit setPivotY(pivotY: Float) Unit setPointerIcon(pointerIcon: PointerIcon!) Unit setPreferKeepClear(preferKeepClear: Boolean) Unit setPreferKeepClearRects(rects: (Mutable)List!) Unit setPressed(pressed: Boolean) Unit setRenderEffect(renderEffect: RenderEffect!) Unit setRevealOnFocusHint(revealOnFocus: Boolean) Unit setRight(right: Int) Unit setRotation(rotation: Float) Unit setRotationX(rotationX: Float) Unit setRotationY(rotationY: Float) Unit setSaveEnabled(enabled: Boolean) Unit setSaveFromParentEnabled(enabled: Boolean) Unit setScaleX(scaleX: Float) Unit setScaleY(scaleY: Float) Unit setScreenReaderFocusable(screenReaderFocusable: Boolean) Unit setScrollBarDefaultDelayBeforeFade(    scrollBarDefaultDelayBeforeFade: Int) Unit setScrollBarFadeDuration(scrollBarFadeDuration: Int) Unit setScrollBarSize(scrollBarSize: Int) Unit setScrollBarStyle(style: Int) Unit setScrollCaptureCallback(callback: ScrollCaptureCallback!) Unit setScrollCaptureHint(hint: Int) Unit setScrollContainer(isScrollContainer: Boolean) Unit setScrollIndicators(indicators: Int) Unit setScrollX(value: Int) Unit setScrollY(value: Int) Unit setScrollbarFadingEnabled(fadeScrollbars: Boolean) Unit setSelected(selected: Boolean) Unit setSoundEffectsEnabled(soundEffectsEnabled: Boolean) Unit setStateDescription(stateDescription: CharSequence!) Unit setStateListAnimator(stateListAnimator: StateListAnimator!) Unit setSystemGestureExclusionRects(rects: (Mutable)List!) Unit setSystemUiVisibility(visibility: Int)

This function is deprecated.

Unit setTag(tag: Any!) Unit setTextAlignment(textAlignment: Int) Unit setTextDirection(textDirection: Int) Unit setTooltipText(tooltipText: CharSequence!) Unit setTop(top: Int) Unit setTouchDelegate(delegate: TouchDelegate!) Unit setTransitionAlpha(alpha: Float) Unit setTransitionName(transitionName: String!) Unit setTransitionVisibility(visibility: Int) Unit setTranslationX(translationX: Float) Unit setTranslationY(translationY: Float) Unit setTranslationZ(translationZ: Float) Unit setVerticalFadingEdgeEnabled(verticalFadingEdgeEnabled: Boolean) Unit setVerticalScrollBarEnabled(verticalScrollBarEnabled: Boolean) Unit setVerticalScrollbarPosition(position: Int) Unit setVerticalScrollbarThumbDrawable(drawable: Drawable!) Unit setVerticalScrollbarTrackDrawable(drawable: Drawable!) Unit setViewTranslationCallback(callback: ViewTranslationCallback!) Unit setVisibility(visibility: Int) Unit setWillNotCacheDrawing(willNotCacheDrawing: Boolean)

This function is deprecated.

Unit setWillNotDraw(willNotDraw: Boolean) Unit setX(x: Float) Unit setY(y: Float) Unit setZ(z: Float) Boolean showContextMenu() ActionMode! startActionMode(callback: ActionMode.Callback!) Unit startAnimation(animation: Animation!) Boolean startDrag(    data: ClipData!,    shadowBuilder: View.DragShadowBuilder!,    myLocalState: Any!,    flags: Int)

This function is deprecated.

Boolean startDragAndDrop(    data: ClipData!,    shadowBuilder: View.DragShadowBuilder!,    myLocalState: Any!,    flags: Int) Boolean startNestedScroll(axes: Int) Unit stopNestedScroll() String! toString() Unit transformMatrixToGlobal(matrix: Matrix!) Unit transformMatrixToLocal(matrix: Matrix!) Unit unscheduleDrawable(who: Drawable!, what: Runnable!) Unit updateDragShadow(shadowBuilder: View.DragShadowBuilder!) Boolean verifyDrawable(who: Drawable!) Boolean willNotCacheDrawing()

This function is deprecated.

Boolean willNotDraw() From android.view.ViewGroup Unit addChildrenForAccessibility(outChildren: ArrayList!) Unit addExtraDataToAccessibilityNodeInfo(    info: AccessibilityNodeInfo!,    extraDataKey: String!,    arguments: Bundle!) Unit addFocusables(views: ArrayList!, direction: Int, focusableMode: Int) Unit addKeyboardNavigationClusters(    views: (Mutable)Collection!,    direction: Int) Boolean addStatesFromChildren() Unit addTouchables(views: ArrayList!) Unit addView(child: View!) Boolean addViewInLayout(child: View!, index: Int, params: ViewGroup.LayoutParams!) Unit attachLayoutAnimationParameters(    child: View!,    params: ViewGroup.LayoutParams!,    index: Int,    count: Int) Unit attachViewToParent(child: View!, index: Int, params: ViewGroup.LayoutParams!) Unit bringChildToFront(child: View!) Boolean canAnimate() Unit childDrawableStateChanged(child: View!) Unit childHasTransientStateChanged(    child: View!,    childHasTransientState: Boolean) Unit cleanupLayoutState(child: View!) Unit clearChildFocus(child: View!) Unit clearDisappearingChildren() Unit clearFocus() Unit debug(depth: Int) Unit detachAllViewsFromParent() Unit detachViewFromParent(child: View!) Unit detachViewsFromParent(start: Int, count: Int) WindowInsets! dispatchApplyWindowInsets(insets: WindowInsets!) Boolean dispatchCapturedPointerEvent(event: MotionEvent!) Unit dispatchConfigurationChanged(newConfig: Configuration!) Unit dispatchCreateViewTranslationRequest(    viewIds: (Mutable)Map!,    supportedFormats: IntArray!,    capability: TranslationCapability!,    requests: (Mutable)List!) Unit dispatchDisplayHint(hint: Int) Boolean dispatchDragEvent(event: DragEvent!) Unit dispatchDrawableHotspotChanged(x: Float, y: Float) Unit dispatchFinishTemporaryDetach() Unit dispatchFreezeSelfOnly(container: SparseArray!) Boolean dispatchGenericFocusedEvent(event: MotionEvent!) Boolean dispatchGenericPointerEvent(event: MotionEvent!) Boolean dispatchHoverEvent(event: MotionEvent!) Boolean dispatchKeyEvent(event: KeyEvent!) Boolean dispatchKeyEventPreIme(event: KeyEvent!) Boolean dispatchKeyShortcutEvent(event: KeyEvent!) Unit dispatchPointerCaptureChanged(hasCapture: Boolean) Unit dispatchProvideAutofillStructure(structure: ViewStructure!, flags: Int) Unit dispatchProvideStructure(structure: ViewStructure!) Unit dispatchRestoreInstanceState(container: SparseArray!) Unit dispatchSaveInstanceState(container: SparseArray!) Unit dispatchScrollCaptureSearch(    localVisibleRect: Rect!,    windowOffset: Point!,    targets: Consumer!) Unit dispatchSetActivated(activated: Boolean) Unit dispatchSetPressed(pressed: Boolean) Unit dispatchSetSelected(selected: Boolean) Unit dispatchStartTemporaryDetach() Unit dispatchSystemUiVisibilityChanged(visible: Int)

This function is deprecated.

Unit dispatchThawSelfOnly(container: SparseArray!) Boolean dispatchTouchEvent(ev: MotionEvent!) Boolean dispatchTrackballEvent(event: MotionEvent!) Boolean dispatchUnhandledMove(focused: View!, direction: Int) Unit dispatchVisibilityChanged(changedView: View!, visibility: Int) Unit dispatchWindowFocusChanged(hasFocus: Boolean) Unit dispatchWindowInsetsAnimationEnd(animation: WindowInsetsAnimation!) Unit dispatchWindowInsetsAnimationPrepare(animation: WindowInsetsAnimation!) WindowInsets! dispatchWindowInsetsAnimationProgress(    insets: WindowInsets!,    runningAnimations: (Mutable)List!) WindowInsetsAnimation.Bounds! dispatchWindowInsetsAnimationStart(    animation: WindowInsetsAnimation!,    bounds: WindowInsetsAnimation.Bounds!) Unit dispatchWindowSystemUiVisiblityChanged(visible: Int)

This function is deprecated.

Unit dispatchWindowVisibilityChanged(visibility: Int) Boolean drawChild(canvas: Canvas!, child: View!, drawingTime: Long) Unit drawableStateChanged() Unit endViewTransition(view: View!) View! findFocus() OnBackInvokedDispatcher! findOnBackInvokedDispatcherForChild(child: View!, requester: View!) Unit findViewsWithText(    outViews: ArrayList!,    text: CharSequence!,    flags: Int) View! focusSearch(focused: View!, direction: Int) Unit focusableViewAvailable(v: View!) Boolean gatherTransparentRegion(region: Region!) CharSequence! getAccessibilityClassName() View! getChildAt(index: Int) Int getChildCount() Int getChildDrawingOrder(childCount: Int, drawingPosition: Int) java-static Int getChildMeasureSpec(spec: Int, padding: Int, childDimension: Int) Boolean getChildStaticTransformation(child: View!, t: Transformation!) Boolean getChildVisibleRect(child: View!, r: Rect!, offset: Point!) Boolean getClipChildren() Boolean getClipToPadding() Int getDescendantFocusability() View! getFocusedChild() LayoutAnimationController! getLayoutAnimation() Animation.AnimationListener! getLayoutAnimationListener() Int getLayoutMode() LayoutTransition! getLayoutTransition() Int getNestedScrollAxes() ViewGroupOverlay! getOverlay() Int getPersistentDrawingCache()

This function is deprecated.

Boolean getTouchscreenBlocksFocus() Boolean hasFocus() Boolean hasTransientState() Int indexOfChild(child: View!) Unit invalidateChild(child: View!, dirty: Rect!)

This function is deprecated.

ViewParent! invalidateChildInParent(location: IntArray!, dirty: Rect!)

This function is deprecated.

Boolean isAlwaysDrawnWithCacheEnabled()

This function is deprecated.

Boolean isAnimationCacheEnabled()

This function is deprecated.

Boolean isChildrenDrawingOrderEnabled() Boolean isChildrenDrawnWithCacheEnabled()

This function is deprecated.

Boolean isLayoutSuppressed() Boolean isMotionEventSplittingEnabled() Boolean isTransitionGroup() Unit jumpDrawablesToCurrentState() Unit layout(l: Int, t: Int, r: Int, b: Int) Unit measureChild(    child: View!,    parentWidthMeasureSpec: Int,    parentHeightMeasureSpec: Int) Unit measureChildWithMargins(    child: View!,    parentWidthMeasureSpec: Int,    widthUsed: Int,    parentHeightMeasureSpec: Int,    heightUsed: Int) Unit measureChildren(widthMeasureSpec: Int, heightMeasureSpec: Int) Unit notifySubtreeAccessibilityStateChanged(    child: View!,    source: View!,    changeType: Int) Unit offsetDescendantRectToMyCoords(descendant: View!, rect: Rect!) Unit offsetRectIntoDescendantCoords(descendant: View!, rect: Rect!) Unit onAttachedToWindow() IntArray! onCreateDrawableState(extraSpace: Int) Unit onDescendantInvalidated(child: View!, target: View!) Unit onDetachedFromWindow() Boolean onInterceptHoverEvent(event: MotionEvent!) Boolean onInterceptTouchEvent(ev: MotionEvent!) Boolean onNestedFling(    target: View!,    velocityX: Float,    velocityY: Float,    consumed: Boolean) Boolean onNestedPreFling(target: View!, velocityX: Float, velocityY: Float) Boolean onNestedPrePerformAccessibilityAction(    target: View!,    action: Int,    args: Bundle!) Unit onNestedPreScroll(target: View!, dx: Int, dy: Int, consumed: IntArray!) Unit onNestedScroll(    target: View!,    dxConsumed: Int,    dyConsumed: Int,    dxUnconsumed: Int,    dyUnconsumed: Int) Unit onNestedScrollAccepted(child: View!, target: View!, axes: Int) Boolean onRequestFocusInDescendants(direction: Int, previouslyFocusedRect: Rect!) Boolean onRequestSendAccessibilityEvent(child: View!, event: AccessibilityEvent!) PointerIcon! onResolvePointerIcon(event: MotionEvent!, pointerIndex: Int) Boolean onStartNestedScroll(child: View!, target: View!, nestedScrollAxes: Int) Unit onStopNestedScroll(child: View!) Unit recomputeViewAttributes(child: View!) Unit removeAllViews() Unit removeAllViewsInLayout() Unit removeDetachedView(child: View!, animate: Boolean) Unit removeView(view: View!) Unit removeViewAt(index: Int) Unit removeViewInLayout(view: View!) Unit removeViews(start: Int, count: Int) Unit removeViewsInLayout(start: Int, count: Int) Unit requestChildFocus(child: View!, focused: View!) Boolean requestChildRectangleOnScreen(    child: View!,    rectangle: Rect!,    immediate: Boolean) Unit requestDisallowInterceptTouchEvent(disallowIntercept: Boolean) Boolean requestFocus(direction: Int, previouslyFocusedRect: Rect!) Boolean requestSendAccessibilityEvent(child: View!, event: AccessibilityEvent!) Unit requestTransparentRegion(child: View!) Boolean restoreDefaultFocus() Unit scheduleLayoutAnimation() Unit setAddStatesFromChildren(addsStates: Boolean) Unit setAlwaysDrawnWithCacheEnabled(always: Boolean)

This function is deprecated.

Unit setAnimationCacheEnabled(enabled: Boolean)

This function is deprecated.

Unit setChildrenDrawingCacheEnabled(enabled: Boolean)

This function is deprecated.

Unit setChildrenDrawingOrderEnabled(enabled: Boolean) Unit setChildrenDrawnWithCacheEnabled(enabled: Boolean)

This function is deprecated.

Unit setClipChildren(clipChildren: Boolean) Unit setClipToPadding(clipToPadding: Boolean) Unit setDescendantFocusability(focusability: Int) Unit setLayoutAnimation(controller: LayoutAnimationController!) Unit setLayoutAnimationListener(    animationListener: Animation.AnimationListener!) Unit setLayoutMode(layoutMode: Int) Unit setLayoutTransition(transition: LayoutTransition!) Unit setMotionEventSplittingEnabled(split: Boolean) Unit setOnHierarchyChangeListener(    listener: ViewGroup.OnHierarchyChangeListener!) Unit setPersistentDrawingCache(drawingCacheToKeep: Int)

This function is deprecated.

Unit setStaticTransformationsEnabled(enabled: Boolean) Unit setTouchscreenBlocksFocus(touchscreenBlocksFocus: Boolean) Unit setTransitionGroup(isTransitionGroup: Boolean) Unit setWindowInsetsAnimationCallback(    callback: WindowInsetsAnimation.Callback!) Boolean showContextMenuForChild(originalView: View!) ActionMode! startActionModeForChild(    originalView: View!,    callback: ActionMode.Callback!) Unit startLayoutAnimation() Unit startViewTransition(view: View!) Unit suppressLayout(suppress: Boolean) Unit updateViewLayout(view: View!, params: ViewGroup.LayoutParams!) Constants DESIGN_INFO_ID Added in 2.2.0-alpha13 const val DESIGN_INFO_ID = 0: Int VERSION Added in 2.2.0-alpha13 const val VERSION = "ConstraintLayout-2.2.0-alpha04": String! Public constructors ConstraintLayout Added in 2.2.0-alpha13 ConstraintLayout(context: Context) ConstraintLayout Added in 2.2.0-alpha13 ConstraintLayout(context: Context, attrs: AttributeSet?) ConstraintLayout Added in 2.2.0-alpha13 ConstraintLayout(context: Context, attrs: AttributeSet?, defStyleAttr: Int) ConstraintLayout Added in 2.2.0-alpha13 @TargetApi(value = Build.VERSION_CODES.LOLLIPOP)ConstraintLayout(    context: Context,    attrs: AttributeSet?,    defStyleAttr: Int,    defStyleRes: Int) Public functions addValueModifier Added in 2.2.0-alpha13 fun addValueModifier(modifier: ConstraintLayout.ValueModifier!): Unit

a ValueModify to the ConstraintLayout. This can be useful to add custom behavour to the ConstraintLayout or address limitation of the capabilities of Constraint Layout

Parameters modifier: ConstraintLayout.ValueModifier! fillMetrics Added in 2.2.0-alpha13 fun fillMetrics(metrics: Metrics!): Unit Parameters metrics: Metrics!

Fills metrics object

forceLayout fun forceLayout(): Unit generateLayoutParams Added in 2.2.0-alpha13 fun generateLayoutParams(attrs: AttributeSet!): ConstraintLayout.LayoutParams! getDesignInformation Added in 2.2.0-alpha13 fun getDesignInformation(type: Int, value: Any!): Any! getMaxHeight Added in 2.2.0-alpha13 fun getMaxHeight(): Int

The maximum height of this view.

Returns Int

The maximum height of this view

See also setMaxHeight getMaxWidth Added in 2.2.0-alpha13 fun getMaxWidth(): Int getMinHeight Added in 2.2.0-alpha13 fun getMinHeight(): Int

The minimum height of this view.

Returns Int

The minimum height of this view

See also setMinHeight getMinWidth Added in 2.2.0-alpha13 fun getMinWidth(): Int

The minimum width of this view.

Returns Int

The minimum width of this view

See also setMinWidth getOptimizationLevel Added in 2.2.0-alpha13 fun getOptimizationLevel(): Int

Return the current optimization level for the layout resolution

Returns Int

the current level

getSceneString Added in 2.2.0-alpha13 fun getSceneString(): String!

Returns a JSON5 string useful for debugging the constraints actually applied. In situations where a complex set of code dynamically constructs constraints it is useful to be able to query the layout for what are the constraints.

Returns String!

json5 string representing the constraint in effect now.

getSharedValues Added in 2.2.0-alpha13 java-static fun getSharedValues(): SharedValues!

Returns the SharedValues instance, creating it if it doesn't exist.

Returns SharedValues!

the SharedValues instance

getViewById Added in 2.2.0-alpha13 fun getViewById(id: Int): View! Parameters id: Int

the view id

Returns View!

the child view, can return null Return a direct child view by its id if it exists

getViewWidget Added in 2.2.0-alpha13 fun getViewWidget(view: View!): ConstraintWidget! Parameters view: View! Returns ConstraintWidget! loadLayoutDescription Added in 2.2.0-alpha13 fun loadLayoutDescription(layoutDescription: Int): Unit

Load a layout description file from the resources.

Parameters layoutDescription: Int

The resource id, or 0 to reset the layout description.

onViewAdded fun onViewAdded(view: View!): Unit onViewRemoved fun onViewRemoved(view: View!): Unit requestLayout fun requestLayout(): Unit setConstraintSet Added in 2.2.0-alpha13 fun setConstraintSet(set: ConstraintSet!): Unit

Sets a ConstraintSet object to manage constraints. The ConstraintSet overrides LayoutParams of child views.

Parameters set: ConstraintSet!

Layout children using ConstraintSet

setDesignInformation Added in 2.2.0-alpha13 fun setDesignInformation(type: Int, value1: Any!, value2: Any!): Unit setId fun setId(id: Int): Unit setMaxHeight Added in 2.2.0-alpha13 fun setMaxHeight(value: Int): Unit

Set the max height for this view

Parameters value: Int setMaxWidth Added in 2.2.0-alpha13 fun setMaxWidth(value: Int): Unit

Set the max width for this view

Parameters value: Int setMinHeight Added in 2.2.0-alpha13 fun setMinHeight(value: Int): Unit

Set the min height for this view

Parameters value: Int setMinWidth Added in 2.2.0-alpha13 fun setMinWidth(value: Int): Unit

Set the min width for this view

Parameters value: Int setOnConstraintsChanged Added in 2.2.0-alpha13 fun setOnConstraintsChanged(    constraintsChangedListener: ConstraintsChangedListener!): Unit

Notify of constraints changed

Parameters constraintsChangedListener: ConstraintsChangedListener! setOptimizationLevel Added in 2.2.0-alpha13 fun setOptimizationLevel(level: Int): Unit

Set the optimization for the layout resolution.

The optimization can be any of the following:

Optimizer.OPTIMIZATION_NONE Optimizer.OPTIMIZATION_STANDARD a mask composed of specific optimizations The mask can be composed of any combination of the following: Optimizer.OPTIMIZATION_DIRECT Optimizer.OPTIMIZATION_BARRIER Optimizer.OPTIMIZATION_CHAIN (experimental) Optimizer.OPTIMIZATION_DIMENSIONS (experimental) Note that the current implementation of Optimizer.OPTIMIZATION_STANDARD is as a mask of DIRECT and BARRIER. Parameters level: Int

optimization level

setState Added in 2.2.0-alpha13 fun setState(id: Int, screenWidth: Int, screenHeight: Int): Unit

Set the State of the ConstraintLayout, causing it to load a particular ConstraintSet. For states with variants the variant with matching width and height constraintSet will be chosen

Parameters id: Int

the constraint set state

screenWidth: Int

the width of the screen in pixels

screenHeight: Int

the height of the screen in pixels

shouldDelayChildPressedState fun shouldDelayChildPressedState(): Boolean Returns Boolean Protected functions applyConstraintsFromLayoutParams Added in 2.2.0-alpha13 protected fun applyConstraintsFromLayoutParams(    isInEditMode: Boolean,    child: View!,    widget: ConstraintWidget!,    layoutParams: ConstraintLayout.LayoutParams!,    idToWidget: SparseArray!): Unit checkLayoutParams protected fun checkLayoutParams(p: ViewGroup.LayoutParams!): Boolean dispatchDraw protected fun dispatchDraw(canvas: Canvas!): Unit dynamicUpdateConstraints Added in 2.2.0-alpha13 protected fun dynamicUpdateConstraints(widthMeasureSpec: Int, heightMeasureSpec: Int): Boolean

This can be overridden to change the way Modifiers are used.

Parameters widthMeasureSpec: Int heightMeasureSpec: Int Returns Boolean generateDefaultLayoutParams Added in 2.2.0-alpha13 protected fun generateDefaultLayoutParams(): ConstraintLayout.LayoutParams! generateLayoutParams protected fun generateLayoutParams(p: ViewGroup.LayoutParams!): ViewGroup.LayoutParams! isRtl Added in 2.2.0-alpha13 protected fun isRtl(): Boolean onLayout protected fun onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int): Unit onMeasure protected fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int): Unit parseLayoutDescription Added in 2.2.0-alpha13 protected fun parseLayoutDescription(id: Int): Unit

Subclasses can override the handling of layoutDescription

Parameters id: Int resolveMeasuredDimension Added in 2.2.0-alpha13 protected fun resolveMeasuredDimension(    widthMeasureSpec: Int,    heightMeasureSpec: Int,    measuredWidth: Int,    measuredHeight: Int,    isWidthMeasuredTooSmall: Boolean,    isHeightMeasuredTooSmall: Boolean): Unit

Handles calling setMeasuredDimension()

Parameters widthMeasureSpec: Int heightMeasureSpec: Int measuredWidth: Int measuredHeight: Int isWidthMeasuredTooSmall: Boolean isHeightMeasuredTooSmall: Boolean resolveSystem Added in 2.2.0-alpha13 protected fun resolveSystem(    layout: ConstraintWidgetContainer!,    optimizationLevel: Int,    widthMeasureSpec: Int,    heightMeasureSpec: Int): Unit

Handles measuring a layout

Parameters layout: ConstraintWidgetContainer! optimizationLevel: Int widthMeasureSpec: Int heightMeasureSpec: Int setSelfDimensionBehaviour Added in 2.2.0-alpha13 protected fun setSelfDimensionBehaviour(    layout: ConstraintWidgetContainer!,    widthMode: Int,    widthSize: Int,    heightMode: Int,    heightSize: Int): Unit Protected properties mConstraintLayoutSpec Added in 2.2.0-alpha13 protected val mConstraintLayoutSpec: ConstraintLayoutStates! mDirtyHierarchy Added in 2.2.0-alpha13 protected val mDirtyHierarchy: Boolean mLayoutWidget Added in 2.2.0-alpha13 protected val mLayoutWidget: ConstraintWidgetContainer!


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3